import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-05-08
 * 17:23
 */
public class Test {
    public static void main(String[] args) {
        int[] arr={3,5,6,9,1,0,29,4,8};
        int[] arr1=fun(arr,12);
        System.out.println(Arrays.toString(arr1));
    }
    public static int[] fun(int[]arr,int x){
        int[] arr1=new int[2];
        for(int i=0;i< arr.length;i++){
            for (int j = 0; j < arr.length; j++) {
                if(arr[i]+arr[j]==x&&i!=j){
                   arr1[0]=i;
                   arr1[1]=j;
                }
            }
        }
        return arr1;
    }
}
